<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>新增员工本薪数据</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript"
	src="<c:url value="js/jquery-easyui-1.5.4.2/jquery.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="js/jquery-easyui-1.5.4.2/jquery.easyui.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="js/jquery-easyui-1.5.4.2/locale/easyui-lang-zh_CN.js"/>"></script>
<link rel="stylesheet" type="text/css"
	href="<c:url value="js/jquery-easyui-1.5.4.2/themes/default/easyui.css"/>" />
<link rel="stylesheet" type="text/css"
	href="<c:url value="js/jquery-easyui-1.5.4.2/themes/icon.css"/>" />

</head>
<body>
<style type="text/css">
	.insert_bt {
		background: #CDDEF4;
	}
</style>
	<script type="text/javascript">
		$(function() {
			$('.return').linkbutton({
				onClick : function() {
					$(".emp_pay_insert").panel({
						href : "to_emp_pay",
					});
				}
			});
			
			//给员工添加按钮，进行弹框
			$('#stain_id').textbox({
				icons:[{
					iconCls:'icon-add',
					handler:function(e){
						$('#lq_emp_pay_StaffInformation').dialog('open');
						//双击获取值
						$('#lq_emp_pay_insert').datagrid({onDblClickRow:function(index,row){
								var stainIds=row.stainId;
								var stainNames=row.stainName;
								$('#stain_id').textbox("setValue",stainIds);
								$('#stain_name').textbox("setValue",stainNames);
								//关闭窗口
								$('#lq_emp_pay_StaffInformation').dialog('close');
							}
						});
					}
				}]
			});
			//给薪资账套添加按钮，进行弹框
			$('#account_id').textbox({
				icons:[{
					iconCls:'icon-add',
					handler:function(e){
						$('#lq_emp_pay_add_salaryAccount').dialog('open');
						//双击获取值
						$('#lq_emp_pay_insert_account').datagrid({onDblClickRow:function(index,row){
								var accountIds=row.accountId;
								var accountNames=row.accountName;
								$('#account_id').textbox('setValue',accountIds);
								$('#account_name').textbox('setValue',accountNames);
								//关闭窗口
								$('#lq_emp_pay_add_salaryAccount').dialog('close');
							}
						});
					}
				}]
			});
			
			
			//保存
			$('#lq_emp_pay_insert_add').linkbutton({onClick:function(){
				$("<form method='post'>").appendTo(document.body).form({
					url: 'emp_pay_add',
						onSubmit: function(params){
							params["stainId"] = $("#stain_id").textbox("getText");
							
							params["stainName"] = $("#stain_name").textbox("getText");
							params["accountId"] = $("#account_id").textbox("getText");
							
							params["accountName"] = $("#account_name").textbox("getText");
							
							params["accountStartdate"] =$("#accountStartdate").datetimebox("getText");
							params["accountEnddate"] =$("#accountEnddate").datetimebox("getText");
						},
						success:function(v){
							v = eval("(" + v + ")");
							if(v.success){
								$(".emp_pay_insert").panel({
									href : "to_emp_pay",
								});
							}else{
								$.messager.alert('错误', '对不起，操作失败，原因：' + v.message);
							}
						}
				}).submit();
			}});
		});
	</script>
	<div class="easyui-panel emp_pay_insert"
		data-options="fit:true,border:false,tools:'#insert_bt'">
		<!-- 按钮 -->
		<div id="insert_bt" class="insert_bt">
			<a class="easyui-linkbutton" data-options="text:'添加',iconCls:'icon-save',plain:true" id="lq_emp_pay_insert_add"></a>
			<a class="easyui-linkbutton return" iconCls="icon-reload"
				plain="true" title="返回" data-options="text:'返回'"></a> 
			<span style="float: right; font-size: 12px; margin-top: 5px;">新增</span>
		</div>
		<!-- 添加面板 -->
		<div style="height: 10px;"></div>
		<div style="margin-left: 10px">
			<form id="paper_insert_form">
				<div style="font-size: 14px;">新增</div>
				<div style="border-top: 2px solid #19aa8d; width: 420px; display: inline-block; margin-right: 15px;" class="paper_insert_shijuan">
					<table cellspacing="10" style="margin-left: 50px;">
						<tbody>
							<tr>
								<td><input class="easyui-textbox" id="stain_id"  
									data-options="label:'员工编号', width:250,labelWidth:130	" /></td>
								<td><input class="easyui-textbox" style="width: 80px;"  id="stain_name"/></td>
							</tr>
							<tr>
								<td><input class="easyui-textbox" id="account_id"  
									data-options="label:'所属账套', width:250,labelWidth:130	" /></td>
								<td><input class="easyui-textbox" style="width: 80px;"  id="account_name"/></td>
							</tr>
						</tbody>
					</table>
				</div>
				<div style="border-top: 2px solid #19aa8d; width: 420px; display: inline-block;">
					<table cellspacing="10" style="margin-left: 50px;">
						<tbody>
							<tr>
							<td><input class="easyui-datetimebox" id="accountStartdate"
								data-options="label:'*开始时日', width:250,labelWidth:130" /></td>
							</tr>
						<tr>
							<td><input class="easyui-datetimebox" id="accountEnddate"
								data-options="label:'*结束时日', width:250,labelWidth:130" /></td>
						</tr>
						</tbody>
					</table>
				</div>
			</form>
		</div>
		<!-- 员工选择弹框 -->
		<div class="easyui-dialog" id="lq_emp_pay_StaffInformation"
			data-options="width:550,height:400,title:'员工选择',
				modal:true,
				closed:true,
				buttons:[{
					text:'确定',
					iconCls:'icon-ok',
					handler:function(){
						<!-- row获取选中行 -->
						var row=$('#lq_emp_pay_insert').datagrid('getSelected');
						<!-- paperinsertid获取行id，paperinsertname获取行name -->
						var stainIds=row.stainId;
						var stainNames=row.stainName;
						<!-- 传值 -->
						$('#stain_id').textbox('setValue',stainIds);
						$('#stain_name').textbox('setValue',stainNames);
						<!-- 关闭窗口 -->
						$('#lq_emp_pay_StaffInformation').dialog('close');
					}
				},{
					text:'取消',
					iconCls:'icon-clear',
					handler:function(){
						$('#lq_emp_pay_StaffInformation').dialog('close');		
					}
				}]">
			<div id="lq_emp_pay_insert_tb">
				<div class="line">
					<input class="easyui-textbox "
						data-options="label:'员工编号',width:350,labelWidth:130" />
				</div>
				<div class="line">
					<input class="easyui-textbox"
						data-options="label:'员工名称',width:350,labelWidth:130" />
					<a class="easyui-linkbutton"
						data-options="text:'搜索',width:100" style="float: right" />
				</div>
			</div>
			<div class="easyui-panel" data-options="fit:true,border:false" >
				<table class="easyui-datagrid" id="lq_emp_pay_insert"
					data-options="
							fit:true,
							singleSelect:true,
							nowrap:true,
							rownumbers:true,
							toolbar:'lq_emp_pay_insert_tb',
							<!-- 分页 -->			
							pagination:true,
							url:'selcet_StaffInformation',
							pageSize:5,
							pageList:[5,10,15]">
					<thead>
						<tr>
							<th data-options="width:140,align:'center',field:'stainId'" id="insert_stainId">员工编号</th>
							<th data-options="width:270,align:'center',field:'stainName'" id="insert_stainName">员工名称</th>
						</tr>
					</thead>
					<tbody>
						
					</tbody>
				</table>
			</div>
		</div>
		<!-- 薪资账套弹框 -->
		 <div class="easyui-dialog" id="lq_emp_pay_add_salaryAccount"
			data-options="width:550,height:400,title:'清单查找-薪资账套',
				modal:true,
				closed:true,
				buttons:[{
					text:'确定',
					iconCls:'icon-ok',
					handler:function(){
						<!-- row获取选中行 -->
						var row=$('#lq_emp_pay_insert_account').datagrid('getSelected');
						<!-- paperinsertid获取行id，paperinsertname获取行name -->
						var accountIds=row.accountId;
						var accountNames=row.accountName;
						<!-- 传值 -->
						$('#account_id').textbox('setValue',accountIds);
						$('#account_name').textbox('setValue',accountNames);
						<!-- 关闭窗口 -->
						$('#lq_emp_pay_add_salaryAccount').dialog('close');
					}
				},{
					text:'取消',
					iconCls:'icon-clear',
					handler:function(){
						$('#lq_emp_pay_add_salaryAccount').dialog('close');		
					}
				}]">
			<div id="exam_paper_insert_tb">
				<div class="line">
					<input class="easyui-textbox "
						data-options="label:'账套编号',width:350,labelWidth:130" />
				</div>
				<div class="line">
					<input class="easyui-textbox"
						data-options="label:'账套名称',width:350,labelWidth:130" />
					<a class="easyui-linkbutton"
						data-options="text:'搜索',width:100" style="float: right" />
				</div>
			</div>
			<div class="easyui-panel" data-options="fit:true,border:false" >
				<table class="easyui-datagrid" id="lq_emp_pay_insert_account"
					data-options="
							fit:true,
							singleSelect:true,
							nowrap:true,
							rownumbers:true,
							toolbar:'exam_paper_insert_tb',
							<!-- 分页 -->			
							pagination:true,
							url:'lzs_findAllduoSalary',
							pageSize:5,
							pageList:[5,10,15]">
					<thead>
						<tr>
							<th data-options="width:140,align:'center',field:'accountId'" id="insert_accountId">账套编号</th>
							<th data-options="width:270,align:'center',field:'accountName'" id="insert_accountName">账套名称</th>
						</tr>
					</thead>
					<tbody>
						
					</tbody>
				</table>
			</div>
		</div>
	</div>
</body>
</html>